<?php

namespace app\index\controller;

use think\Controller;

class Base extends Controller
{
    public function initialize()
    {
        $systemInfo = model('System')->find();
        $cates = model('Cate')->order(['sort' => 'desc'])->select();
        $upArticles = model('Article')->order('id', 'desc')
            ->limit(10)->where('aup', 1)->select();
        $viewData = [
            'cates' => $cates,
            'upArticles' => $upArticles,
            'systemInfo' => $systemInfo
        ];
        $this->view->share($viewData);
    }
}
